package com.lwd.spring.study;

import com.lwd.spring.study.config.CustomerConfig;
import com.lwd.spring.study.core.BeanFactoryPostProcessor.SimplePO;
import com.lwd.spring.study.entity.User;
import com.lwd.spring.study.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author: 刘东（挂兰）
 * @Date: 2023/12/12 19:31:46
 * @Description:
 */
//@Slf4j
public class MainStart {
    public static void main(String[] args) {
//        new ClassPathXmlApplicationContext()
//       ApplicationContext applicationContext  = new AnnotationConfigApplicationContext(CustomerConfig.class);
//        UserService userService = applicationContext.getBean(UserService.class);
//        User user = userService.getUser();
//        System.out.println("user = " + user);
//        System.out.println(applicationContext.getBean("simpleBean"));

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring.xml");
        SimplePO bean = applicationContext.getBean(SimplePO.class);
        System.out.println("bean = " + bean);
    }
}
